/*
*去空格
*/
function trim(value){
		return value.replace(/(^\s*)|(\s*$)/g,"");
}
/*
*IN NULL OR EMPTY
*/
function isNullOrEmpty(value){
	if(!value == undefined){
		trim(value);
	}
	//value=value.trim();
	var result = false;
	if (value == null || 
		value == undefined || 
		value == "null" || 
		value == ""){
		result = true;
	}
	return result;
}
	
	
// 字符串是否为数字
function strIsNum(str){
	var num;
	
	num = new Number(str);
	return !isNaN(num);
}
/**
 *
 * xugy
 *
 **/
function deletes(ctx){
	var ids = getSelectIDs();
	if(isNullOrEmpty(ids)){
		return;
	}
	var form = document.getElementsByTagName("form")[0];
	form.elements["ids"].value = ids;
	form.elements["method"].value = "deleteArticle";
	form.submit();
	//window.location.href = ctx + "/article/articleManage.do?method=deleteArticle&ids=" + ids;
}
/*
验证
*/
function checkAdd(){
var result=false;
var value=document.getElementById("article.title").value;
if(isNullOrEmpty(value)){
	alert('请填写标题');
	return result;
}
value=document.getElementById("article.url").value;
if(isNullOrEmpty(value)){
	alert('请填写URL');
	return result;
}
value=document.getElementById("article.sequence").value;
if(isNullOrEmpty(value)){
	alert('请填写顺序！');
	return result;
}else{
	if(strIsNum(value)){
				if(value>127){
				alert('顺序值只能填写 0~127之间的数字！');
				return result;
				}	
		}else{
			alert('顺序只能填写 数字！');
			return result;
		}
}
return true;
}